from mcp.server.fastmcp import FastMCP

mcp = FastMCP("MathServer")

@mcp.tool()
def add(a: int, b: int) -> int:
    """执行两个整数的加法运算"""
    return a + b

@mcp.tool()
def multiply(a: int, b: int) -> int:
    """执行两个整数的乘法运算"""
    return a * b

@mcp.tool()
def divide(a: int, b: int) -> float:
    """执行两个数的除法运算（支持小数）"""
    return round(a / b, 2)

if __name__ == "__main__":
    mcp.run(transport="stdio")